-
Notifications
You must be signed in to change notification settings - Fork 853
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rename RpcRequest
to RpcApiRequestPlan
#3146
Conversation
🦋 Changeset detectedLatest commit: 769effe The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
packages/rpc-spec/src/rpc.ts
Outdated
@@ -63,7 +63,7 @@ function makeProxy<TRpcMethods, TRpcTransport extends RpcTransport>( | |||
|
|||
function createPendingRpcRequest<TRpcMethods, TRpcTransport extends RpcTransport, TResponse>( | |||
rpcConfig: RpcConfig<TRpcMethods, TRpcTransport>, | |||
pendingRequest: RpcRequest<TResponse>, | |||
pendingRequest: PendingRpcApiRequest<TResponse>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice. I think the relationship makes sense. Give me a pending RPC API request, and I'll turn it into a pending RPC request using the transport.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a little bearish on the ‘pending’ moniker because that implies that it, alone, will resolve. I think of this object as more of ‘instructions for making a request’ or ‘a recipe for making a request.’ RpcRequestDescriptor
? RpcRequestPlan
? RpcRequestRecipe
?
@steveluscher I don't mind something like EDIT: I went with |
a1ec679
to
2473269
Compare
39ddfd0
to
5463398
Compare
2473269
to
cd9b1b2
Compare
7ac67e3
to
5b947a4
Compare
RpcRequest
to PendingRpcApiRequest
RpcRequest
to RpcApiRequestPlan
5b947a4
to
ac5e7f8
Compare
cd9b1b2
to
f16d5af
Compare
ac5e7f8
to
8e0c480
Compare
Merge activity
|
8e0c480
to
769effe
Compare
Because there has been no activity on this PR for 14 days since it was merged, it has been automatically locked. Please open a new issue if it requires a follow up. |
In this PR, we continue cleaning up the type namespace by renaming
RpcRequest
toRpcApiRequestPlan
. This is because:RpcRequest
will be used to define a proper request interface that will unify the RPC layers.RpcApiRequestPlan
better describes what the type actually does. If you callmyRpcApi.myMethod({ foo: 42 })
, then you will be given an object that contains everything you need to send it to a transport without actually sending it to a transport. This is the role of theRpc
type which wraps theRpcApi
proxy and transforms thisRpcApiRequestPlan
into aPendingRpcRequest
which contains the desiredsend
function.